package test.day12.test23;

class Animal{
    public int get(int n){
        return n;
    } 
}
class Dog extends Animal {
    public int get(int n){
       return n+super.get(n);   //n+n = 2n
    }
}
class Cat extends Animal {
    public int get(int n){
       return n*super.get(n); // n*n
    }
}
public class E {
   public static void main(String args[]){
       Animal animal = new Dog();
       int m = animal.get(10); // 20
       animal = new Cat();
       int n = animal.get(10); //100
       System.out.printf("%d:%d",m,n); //【代码】
   }
}
